import _request from "../common/_request";
import {Message} from "element-ui";
import _router from "../common/_router";

let api_clue = {

    //项目信息
    info: function (activity_id, sid, callback) {

        let data = {};
        data.activity_id = activity_id;
        data.sid = sid;
        _request._get('/clue/info', data, function (response) {
            if (response.code !== _request.success) {
                _router.jmp_error(response.msg)
                return;
            }

            callback(response.data)
        })
    },

    //项目信息
    order: function (data, callback) {

        _request._post('/clue/order', data, function (response) {
            if (response.code !== _request.success) {
                Message.error(response.msg)
                return;
            }

            callback(response.data)
        })
    },

    //项目信息
    clue: function (id, callback) {

        let data = {};
        data.id = id;
        console.log(data, '入参')
        _request._get('/clue/clue', data, function (response) {
            console.log(response, 'response')
            if (response.code !== _request.success) {
                Message.error(response.msg)
                // _router.jmp_error(response.msg)
                return;
            }

            callback(response.data)
        })
    },
}


export default api_clue
